const express = require('express')
var multer  = require('multer')
var router = express.Router()

var upload = multer({ dest: './public/upload' });

router.get('/', (req, res) => res.render('upload.html'))

router.post('/upload', upload.single('logo'), function (req, res) {

    var file = req.file;
    console.log('文件类型：%s', file.mimetype);
    console.log('原始文件名：%s', file.originalname);
    console.log('文件大小：%s', file.size);
    console.log('文件保存路径：%s', file.path);

    console.log(req.body)
    console.log(file)
})

module.exports = router